﻿@model IEnumerable<Capstone_20130302.Models.Order>
@{
    ViewBag.Title = "Order Management";
    Layout = "~/Views/Shared/_MerchantLayout.cshtml";
}

<script src="~/Scripts/jquery.dataTables.js"></script>
<script src="~/Scripts/dataTables.bootstrap.js"></script>


<script type="text/javascript" charset="utf-8">
    $(document).ready(function () {
        $('#example').dataTable({
            "sDom": "<'row spare-down'<'span4'f><'span3'l>r>t<'row'<'span3'i><'span8'p>>",
            "sPaginationType": "bootstrap",
            "oLanguage": {
                "sLengthMenu": "_MENU_ records per page"
            }
        });
    });
</script>


@if (Model.ToList().Count > 0)
{
    <div class="form-inline data-content">
        <table cellpadding="0" cellspacing="0" border="0" class="display table table-striped table-bordered" id="example">
            <thead>
                <tr>
                    <th>Order ID
                    </th>
                    <th>Create Date
                    </th>
                    <th>Billing Name
                    </th>
                    <th>Shipping Name
                    </th>
                    <th>Total Payment
                    </th>
                     <th>Status
                    </th>
                    <th>Action </th>
                </tr>
            </thead>
            <tbody>

                @foreach (var item in Model)
                {
                    <tr>
                        <td>
                            @Html.DisplayFor(modelItem => item.OrderId)
                        </td>
                        <td>
                            @Html.DisplayFor(modelItem => item.OrderDate)
                        </td>
                        <td>
                            @Html.DisplayFor(modelItem => item.BillingName)
                        </td>
                        <td>
                            @Html.DisplayFor(modelItem => item.ShippingName)
                        </td>
                         <td>
                            @item.TotalPayment
                        </td>
                        <td data-pid="@item.OrderId" id= "status-@item.OrderId">
                            <span class="or-@item.StatusId">@item.Status.Name</span>
                        </td>
                        <td data-pid="@item.OrderId">
                            <a href="../Order/Details/@item.OrderId"><i class="icon-search"></i> View</a>
                            @*<a href="Product/Delete/@item.ProductId"><i class="icon-trash"></i></a>*@
                        </td>
                    </tr>
                }
            </tbody>

        </table>
    </div>
}
else
{
    <div class="dl-message">
        <div class="head">
            <h4>Empty Order Stack</h4>
        </div>
        <div class="body">
            It seems that your store is quite quiet at the moment. But don't worry. Introduce more friends to your business. People gotta know your products.
        </div>
        <div class="tail"></div>
    </div>
}